package com.bobo.model;

/**
 * Created by bobo on 2016/10/23.
 */

import com.bobo.annotations.*;


import java.sql.Timestamp;
import java.util.List;

/**
 * 用户
 */
@Table("t_user")
public class User {

    @Id
    private Integer id;
    @Column(value = "name")
    private String name;
    @Column(value = "sex")
    private Integer sex; // 男0 女1
    @Column(value = "birthday")
    private Timestamp birthday;



    @ManyToOne
    @Column("photo_id")
    private Photo photo;

    @ManyToOne
    @Column(value = "person_id")
    private Person person;

    @Lst(Tag.class)
    private List<Tag> tags;
//    private String phone;
//    private String email;
//    private String address;
//    private String password;
//    private Photo photo;
//    private Integer status;//状态
//    private List<Topic> collection;//收藏的文章
//    private List<Topic> publish;//发表的文章


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Timestamp getBirthday() {
        return birthday;
    }

    public void setBirthday(Timestamp birthday) {
        this.birthday = birthday;
    }

    public Person getPerson() {
        return person;
    }

    public void setPerson(Person person) {
        this.person = person;
    }

    public List<Tag> getTags() {
        return tags;
    }

    public void setTags(List<Tag> tags) {
        this.tags = tags;
    }

    public Photo getPhoto() {
        return photo;
    }

    public void setPhoto(Photo photo) {
        this.photo = photo;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", value='" + name + '\'' +
                ", sex=" + sex +
                ",birthday="+birthday+
//                ",person="+person.getId()+
                '}';
    }
}
